package com.boot.mall.member.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.boot.common.utils.PageUtils;
import com.boot.common.utils.Query;

import com.boot.mall.member.dao.MemberLevelDao;
import com.boot.mall.member.entity.MemberLevelEntity;
import com.boot.mall.member.service.MemberLevelService;


@Service("memberLevelService")
public class MemberLevelServiceImpl extends ServiceImpl<MemberLevelDao, MemberLevelEntity> implements MemberLevelService {

    @Override
    public PageUtils pageMemberLevel(Map<String, Object> params) {
        // 获取参数
        long current = Integer.parseInt(params.get("page").toString());
        long limit = Integer.parseInt(params.get("limit").toString());
        // 创建分页对象
        Page<MemberLevelEntity> page = new Page<>(current,limit);
        // 执行查询
        baseMapper.selectPage(page,null);
        // 结果封装
        PageUtils pageUtils = new PageUtils(page.getRecords(),(int)page.getTotal(),(int)page.getSize(),(int)current);
        return pageUtils;
    }
}